package com.wzq.animal.back.controller.dto;

import com.wzq.animal.back.service.RolePermissionService;
import com.wzq.animal.common.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/rolePermission")
public class RolePermissionController {
    @Autowired
    private RolePermissionService rolePermissionService;

    @PostMapping("/updateRolePermission/{roleId}")
    public Result updateRolePermission(@PathVariable("roleId") Integer roleId, @RequestBody List<Integer> permissionIds){
        rolePermissionService.setRolePermission(roleId,permissionIds);
        return Result.success();
    }
}
